﻿/*    
 * Copyright (C) 2010-2011, BlizzTV Project - http://code.google.com/p/blizztv/
 *  
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General 
 * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your 
 * option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
 * for more details.
 * 
 * You should have received a copy of the GNU General Public License along with this program.  If not, see 
 * <http://www.gnu.org/licenses/>. 
 * 
 * $Id: Zip.cs 360 2011-02-08 21:21:46Z shalafiraistlin@gmail.com $
 */

using Ionic.Zip;

namespace BlizzTV.Utility.Helpers
{   
    /// <summary>
    /// Helper class that provides ZIP functionalities.
    /// </summary>
    public static class Zip
    {
        public static void Extract(string filePath, string targetPath)
        {
            using (ZipFile zip = ZipFile.Read(filePath))
            {
                foreach (ZipEntry entry in zip)
                {
                    entry.Extract(targetPath, ExtractExistingFileAction.OverwriteSilently);
                }
            }
        }        
    }
}
